home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / BACKUP / KWS130.ZIP;1 / KWS.DOC next >
Encoding:
Text File  |  1993-02-05  |  17.2 KB  |  419 lines

  1.  
  2.  
  3.  
  4.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 1
  5.  
  6.  
  7.      DESCRIPTION
  8.      -----------
  9.      KWS (KeyWord Search) is a small, fast program that performs logical
  10.      AND/OR/NOT searches for keywords within one or more text or binary
  11.      files. KWS has many features and options, including:
  12.  
  13.        * Prefix, suffix, and whole word searches.
  14.        * Case-sensitive searches.
  15.        * Adjustable fuzzy searches.
  16.        * Subdirectory searches.
  17.        * Highlight keywords in bold onscreen.
  18.        * Display line numbers or file offset position.
  19.        * Display total lines per file and per search.
  20.        * Wildcard filename searches.
  21.        * Read data from standard input.
  22.        * Read/write filenames from/to a file list.
  23.        * Search hidden and system files.
  24.        * Stop search after a specified number of matches.
  25.        * Smart pause that detects your screen size.
  26.        * Adjustable window size for searching groups of lines.
  27.        * Display files onscreen while routing to a device or file.
  28.        * Strip control characters from text files.
  29.        * Search/convert text files created on other platforms.
  30.        * Runs on any PC compatible using DOS 2.0 or higher.
  31.  
  32.  
  33.      DISCLAIMER
  34.      ----------
  35.      KWS is distributed on an "AS IS" basis without warranty, expressed or
  36.      implied. Considerable testing effort has been expended, but the user
  37.      is advised to check the program's suitability before relying on it.
  38.      The user assumes full risk as to the results of using this program. In
  39.      no event shall the author be liable for any incidental or
  40.      consequential damages arising from the use, or inability to use this
  41.      program.
  42.  
  43.  
  44.      REGISTRATION
  45.      ------------
  46.      The unregistered version of KWS is freely distributable and fully
  47.      functional, and may be used for a 30-day trial period. If you plan to
  48.      continue using KWS, you are obligated to pay the modest registration
  49.      fee of $20. Registered users will receive an individually serialized
  50.      nag-free version of KWS, a free upgrade, and $5 subsequent upgrades.
  51.  
  52.      All registration information is contained in the KWS.REG file. If that
  53.      file is missing, register by sending your name and address (please
  54.      print), and a check or money order for $20 to:
  55.  
  56.         Copy Con Incorporated
  57.         PO Box 23255
  58.         Baltimore MD 21203-5255
  59.  
  60.      Please specify 3.5" or 5.25" diskette. MD residents add 5% sales tax.
  61.      Thank you for supporting Shareware.
  62.  
  63.  
  64.  
  65.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 2
  66.  
  67.  
  68.      OPERATION
  69.      ---------
  70.      KWS is activated from the command line, using the format
  71.  
  72.         KWS [@]filename search_string[...] [options]
  73.  
  74.      Parameters surrounded by [brackets] are optional.
  75.  
  76.      The @ symbol, if used, must be directly followed by the name of a text
  77.      file containing valid filespecs; the files to be searched will be read
  78.      from that file list. (File lists can be created with KWS using the /M
  79.      option; see OPTIONS.)
  80.  
  81.      If the @ symbol is not used, the filename is the filespec to be
  82.      searched. Wildcards are optional. (For a description of wildcards and
  83.      filespecs, see your DOS manual.)
  84.  
  85.      Each search string is comprised of keywords separated by semicolons.
  86.      At least one keyword from each search string must be present in a
  87.      given line for it to be displayed; for example,
  88.  
  89.         KWS allfiles.lst fixed;hard disk;drive
  90.  
  91.      will display the lines in file ALLFILES.LST that contain either words
  92.      FIXED or HARD (or both), and also contain either words DISK or DRIVE.
  93.  
  94.      If a search string contains a keyword with embedded spaces, the entire
  95.      search string must be enclosed in quotes; for example,
  96.  
  97.         KWS temp.bat "del *;era *"
  98.  
  99.      will search TEMP.BAT for the phrase "del *" or "era *" (without the
  100.      quotes).
  101.  
  102.      A logical 'NOT' search can be conducted by preceding a keyword with
  103.      an exclamation (!) character; for example,
  104.  
  105.         KWS stuff.txt this !that
  106.  
  107.      will display the lines in STUFF.TXT that contain the word THIS and not
  108.      the word THAT. If you wish to search for an exclamation as the first
  109.      (or only) character of a keyword, use two in a row; for example,
  110.  
  111.         KWS stuff.txt this !!that
  112.  
  113.      will display lines that contain both words THIS and !THAT. Exclamation
  114.      characters inside or following keywords (as in " HEY! " or " What!? ")
  115.      do not have to be doubled.
  116.  
  117.      A fuzzy search can be conducted by preceding a keyword with a tilde
  118.      (~) character; lines with words that are similar to the keyword will
  119.      be displayed. This option is useful if you aren't sure of a keyword's
  120.      correct spelling, or if a keyword may be spelled incorrectly in the
  121.      files to be searched. for example,
  122.  
  123.  
  124.  
  125.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 3
  126.  
  127.  
  128.      OPERATION (continued)
  129.      ---------------------
  130.  
  131.         KWS gnu.txt ~copyrite
  132.  
  133.      will display lines with words similar to COPYRITE. (The similarity
  134.      percentage can be adjusted with the /F option; see OPTIONS.) If you
  135.      wish to combine a fuzzy search with a logical 'NOT' search, use the
  136.      'NOT' character before the tilde (as in " !~THE "). Fuzzy searches
  137.      cannot be combined with prefix/suffix/whole word searches (described
  138.      below).
  139.  
  140.      Whole word searches can be conducted by putting underscore (_)
  141.      characters before and after the keyword; for example,
  142.  
  143.         KWS files.lst _c_ source
  144.  
  145.      will display lines in FILES.LST that contain a lone 'C' and the word
  146.      SOURCE. Similarly, prefixes can be searched for by putting an
  147.      underscore before a keyword, and suffixes can be searched for by
  148.      putting an underscore after a keyword. If you wish to search for an
  149.      underscore as the first or last (or only) character of a keyword, use
  150.      two underscores in a row, as with the logical 'NOT' exclamation
  151.      character above. If you wish to combine a prefix/whole word search
  152.      with a logical 'NOT' search, use the 'NOT' character before the
  153.      underscore (as in " !_c_ "). Prefix/suffix/whole word searches cannot
  154.      be combined with fuzzy searches (described above).
  155.  
  156.      Up to 10 search strings are allowed, with up to 10 keywords per
  157.      string.
  158.  
  159.  
  160.      OPTIONS
  161.      -------
  162.      Options can appear anywhere on the command line after the filename.
  163.      They can be in any order, and are not case-sensitive. Options can be
  164.      separated by spaces (/L3 /P /T) or strung together (/L3/P/T or /L3PT).
  165.  
  166.      Option   Description
  167.  
  168.        /A     When this option is used with the /L (line number or offset)
  169.               option, all binary files will automatically be shown with
  170.               hexadecimal file offsets, as if /L0 and /X were used.
  171.  
  172.        /B     This option makes the keywords stand out from the rest of the
  173.               displayed line. When using this option, output cannot be
  174.               routed using DOS redirection; use the /O option instead.
  175.  
  176.        /C     Search will be case-sensitive. Case-sensitive searches are
  177.               approximately 20% faster than case-insensitive searches.
  178.  
  179.        /D     Control characters (ASCII value less than 32) within text
  180.               files will be replaced with spaces before being viewed or
  181.               routed.
  182.  
  183.  
  184.  
  185.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 4
  186.  
  187.  
  188.      OPTIONS (continued)
  189.      -------------------
  190.        /E     The command line will be echoed as the first output line.
  191.               Useful mainly with redirected files to avoid repetition, and
  192.               for testing batch files.
  193.  
  194.        /Fn    This option controls the similarity percentage for fuzzy
  195.               searches. Similarity defaults to 65 percent, and can be
  196.               adjusted from 0 (display almost every line) to 100 (display
  197.               exact matches).
  198.  
  199.        /H     Hidden and/or system files will also be searched.
  200.  
  201.        /Kc    Change the keyword separator charactor from a semicolon to
  202.               the specified character. This option may be needed to pass
  203.               multiple keyword parameters to a batch file (as some versions
  204.               of DOS remove semicolons from batch parameters), or if a
  205.               semicolon is part of a keyword to be searched.
  206.  
  207.        /L[n]  Line numbers or file offset position will be displayed with
  208.               output. If the specified width begins with a zero, then the
  209.               file offset will be displayed; otherwise, line numbers will
  210.               be displayed. If no width is specified, the numbers will be
  211.               left-justified, with a colon between the number and the text;
  212.               otherwise, the numbers will be right-justified and zero-
  213.               padded to the left, followed by the colon and text. If the
  214.               specified width is too small for a number to fit, the number
  215.               will NOT be truncated.
  216.  
  217.        /M[n]  Stop searching after n matches per file. /M alone will cause
  218.               KWS to print only the filenames of successful searches, and
  219.               these can be redirected to a file to be used as a file list.
  220.  
  221.        /Ofn   Route output to the specified device/filename. Output will be
  222.               in addition to, not instead of, output displayed onscreen. To
  223.               route output without viewing, use DOS redirection instead of
  224.               this option (see your DOS manual for details). Do not append
  225.               other options on to the end of this option.
  226.  
  227.        /P     Pause between each screen of text. KWS will autodetect your
  228.               screen size, and pause accordingly. While paused, pressing
  229.               the 'C' key will display the current and any remaining files
  230.               continuously. Pressing the Escape key while paused will skip
  231.               the current file and go on to the next. This option will be
  232.               inactive when the /R option is used.
  233.  
  234.        /R     Instead of reading from text files, KWS will act as a filter
  235.               or pipe (input is taken from an input device or from another
  236.               program's output). When in this mode, the /P, /V, and /W
  237.               options will be inactive. Do not specify a filename when
  238.               using this option.
  239.  
  240.        /S     Subdirectories will also be searched. This option is valid
  241.               only with wildcard and file list searches.
  242.  
  243.  
  244.  
  245.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 5
  246.  
  247.  
  248.      OPTIONS (continued)
  249.      -------------------
  250.        /T     Display total lines found per file. For wildcard and file
  251.               list searches, a grand total will also be displayed.
  252.  
  253.        /V     If KWS cannot determine if a file is binary or text, text
  254.               will be assumed; using this option will tell KWS to treat all
  255.               files as binary. This option is inactive when using the /R
  256.               option; standard input is always assumed to be text.
  257.  
  258.        /Wn    Normally, all keywords must be on the same line for the line
  259.               to be printed; use this option to look at more than one line
  260.               at a time. If all keywords are found within the specified
  261.               window size (maximum of 32767 lines), then the lines will be
  262.               printed, starting with the first line to contain a keyword,
  263.               and ending with the last line to contain a keyword. This
  264.               option will be inactive when searching a binary file or when
  265.               using the /R option.
  266.  
  267.        /X     When this option is used with the /L option, line numbers and
  268.               offset positions will be displayed in hexadecimal format
  269.               instead of decimal.
  270.  
  271.  
  272.      EXAMPLES
  273.      --------
  274.      KWS catalog.lst dvorak keyboard /p
  275.        will take the lines in file CATALOG.LST that contain the words
  276.        DVORAK and KEYBOARD, and display them one screen at a time.
  277.  
  278.      KWS catalog.lst arc;lzh shell /l5 /oprn
  279.        will take the lines in file CATALOG.LST that contain either ARC or
  280.        LZH, and also contain SHELL, and display them onscreen with line
  281.        numbers, while sending them to the printer (PRN).
  282.  
  283.      KWS allfiles.lst /c !.ZIP >nozip.lst
  284.        will make a file called NOZIP.LST, which will contain all of the
  285.        lines in ALLFILES.LST that do NOT contain the word .ZIP in caps.
  286.        Output will not be seen onscreen.
  287.  
  288.      KWS \dl\*.lst MIDI /ptc
  289.        will search all .LST files in the DL directory for the word MIDI in
  290.        capital letters, and displays the filenames and lines onscreen, one
  291.        screen at a time, with totals for each file.
  292.  
  293.      KWS *.bak _the_
  294.        will search the backup files for lines that contain the word THE,
  295.        but will not display them if THE is part of another word (as in
  296.        THESIS or OTHER).
  297.  
  298.      KWS temp.bak _the_;!_the_ /b
  299.        will display every line in TEMP.BAK, hilighting any occurrance of
  300.        the word THE.
  301.  
  302.  
  303.  
  304.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 6
  305.  
  306.  
  307.      EXAMPLES (continued)
  308.      --------------------
  309.      KWS c:\*.bat _del;_era /s/h
  310.        will search all of the batch files on the C: drive, including those
  311.        with their hidden and/or system attributes set, to see if any of
  312.        them delete/erase files.
  313.  
  314.      dir | KWS -92 /r
  315.        pipes the output from the DIR command into KWS, which will display
  316.        the directory entries from 1992.
  317.  
  318.      KWS ; /r /l3 <one.txt >two.txt
  319.        creates file TWO.TXT which is a duplicate of file ONE.TXT, except
  320.        that TWO.TXT will have 3-digit line numbers. (A search for the
  321.        keyword separator will find every line.)
  322.  
  323.      KWS unix.man ; >unix.doc
  324.        converts a Unix format text file (LF delimited) into a DOS format
  325.        text file (CR/LF delimited). KWS can also read CR delimited files.
  326.  
  327.      KWS *.doc ~copyrite /f70b
  328.        will search the .DOC files for words similar to COPYRITE, hilighting
  329.        any close calls.
  330.  
  331.      KWS *.doc ~copyrite !1993 /f70b
  332.        will display the same lines as the above example, except for lines
  333.        containing the word 1993.
  334.  
  335.      KWS allfiles.lst _c_;assem;asm src;source /pb
  336.        will display all lines in ALLFILES.LST that have to do with C or
  337.        assembler source code. Keywords will be in bold, and output will be
  338.        paused after each screen.
  339.  
  340.      KWS allfiles.lst _c_;assem;asm src;source !c++ /pb
  341.        will display the same as above, except C++ files will not be shown.
  342.  
  343.      KWS \dl\*.zip .DOC /cm
  344.        looks inside of ZIP files for any .DOC files, displaying the ZIP
  345.        filename if any are found.
  346.  
  347.      KWS \*.com ; /hal6p /od:com.txt
  348.        examines all (even hidden/system) .COM files in the root directory,
  349.        using hex file offsets 6 characters wide, pausing at each screen,
  350.        while also sending output to file COM.TXT on the D: drive.
  351.  
  352.      KWS p_simon.txt /cbw2 Ms;Miss;Mrs Robinson
  353.        will do a case-sensitive search for Ms or Miss or Mrs Robinson, and
  354.        will display matches in bold, as long as Ms;Miss;Mrs is no more than
  355.        one line's distance from Robinson.
  356.  
  357.      KWS kws.doc ; /pdolpt2
  358.        displays this file, one screen at a time, removing embedded form-
  359.        feed characters, while also sending output to printer LPT2.
  360.  
  361.  
  362.  
  363.      KWS V1.30 Copyright (c) 1991-1993 Copy Con Incorporated         Page 7
  364.  
  365.  
  366.      EXAMPLES (continued)
  367.      --------------------
  368.      KWS c:\*.bat ; /sm >filelist.txt
  369.        will create a file named FILELIST.TXT containing the names of all of
  370.        the batch files on the C: drive. This file is used in the next
  371.        example.
  372.  
  373.      KWS @filelist.txt label "if %;goto"
  374.        will search the filenames in FILELIST.TXT, and display lines in
  375.        those files that contain the word LABEL and either the word GOTO or
  376.        the phrase "IF %" (without the quotes). Note that this example has
  377.        only two search strings, not three; if any words in a search string
  378.        contain spaces, then the entire search string must be in quotes.
  379.  
  380.  
  381.      RETURN CODES
  382.      ------------
  383.      The DOS errorlevel will be set if a search is unsuccessful:
  384.  
  385.      Level  Description
  386.  
  387.        1    Invalid command line options
  388.  
  389.        2    None of the files contain the search string(s)
  390.  
  391.        3    Ctrl-Break interrupt
  392.  
  393.        4    Invalid directory specified
  394.  
  395.        5    No files match filespec
  396.  
  397.        6    Unable to open output file
  398.  
  399.  
  400.      SUPPORT
  401.      -------
  402.      If you have questions, comments, suggestions, bug reports, et cetera,
  403.      feel free to contact me by one of the following methods:
  404.  
  405.      1: By modem at The Programmer's Corner (301-596-7692 or 410-995-6873).
  406.         Send a message to RD Thomas in the Shareware or General conference,
  407.         and check back in a couple of days for a reply.
  408.  
  409.      2: On a BBS that carries the RIME Shareware conference (RD Thomas,
  410.         node ->1520). Allow at least one week for a reply.
  411.  
  412.      3: By US Mail at the address given on the first page. If you would
  413.         like a reply, please include a self-addressed, stamped envelope.
  414.  
  415.      Looking forward to hearing from you.
  416.  
  417.  
  418.      To print this document, type "COPY KWS.DOC PRN" at the DOS prompt.
  419.